1
The Shift to Object-Oriented Programming (OOP)
EvoClass-AI001 Lecture 10
00:00

The Shift to Object-Orientied Programming (OOP)

Object-Oriented Programming (OOP) is a software design approach that structures code around data, known as objects, rather than functions and sequential logic (the procedural approach). This method provides a clear, powerful way to organize code, especially for large, complex applications like web systems or advanced analytics pipelines.

1. Focusing on the Object

Unlike traditional programming, which focuses on writing steps to manipulate data, OOP centers on creating self-contained units (Objects) that bundle attributes (the data defining the object) and methods (the functions that the object can perform).

# Customer Object Example
# Attributes: Name, Address, Order History
# Methods: Log In(), Place Order()

This bundling is called Encapsulation.

2. Key Benefits of Adopting OOP

  • Modularity: By isolating code into objects, the system becomes highly modular, meaning individual parts can be managed and fixed without affecting the whole.
  • Reusability: Once an object type (defined by a Class) is created, it can be instantiated (used) multiple times throughout the application, saving development time.
  • Closer Real-World Mapping: OOP allows developers to model system components directly after real-world entities, making the code much easier for humans to understand and maintain.
Class vs. Object
The Class is the blueprint or template (e.g., the idea of a 'Car'). The Object (or instance) is the physical item created from that blueprint (e.g., 'My Red Honda Civic'). You define the Class once, but you can create many unique Objects from it.
main.py
TERMINAL bash — 80x24
> Ready. Click "Run" to execute simulation.
>